//
//  HRZRecommendSupplierCell.m
//  EMarket
//
//  Created by 石头 on 2018/5/15.
//  Copyright © 2018年 好日子. All rights reserved.
//

#import "HRZRecommendSupplierCell.h"

#import "HRZ_BrandsSortHeaderView.h"
#import "HRZShowGoodsSimpleInfoCell.h"


static NSString * const HRZBrandsSortHeaderViewID = @"HRZ_BrandsSortHeaderView";
static NSString * const HRZListGridCellID = @"HRZShowGoodsSimpleInfoCell";

@interface HRZRecommendSupplierCell()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
{
    CGSize itemSize;
}


@property (weak, nonatomic) IBOutlet UIImageView *supplierBGImage;
@property (weak, nonatomic) IBOutlet UILabel *supplierName;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;

@end

@implementation HRZRecommendSupplierCell

- (void)updateConstraints {
    
    
    
    [super updateConstraints];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    itemSize = CGSizeMake((CGRectGetWidth(self.frame) - 60)/3, (CGRectGetWidth(self.frame) - 60)/3 + 20);
    
    self.collectionView.delegate = self;
    self.collectionView.dataSource = self;
    
    //注册
    [_collectionView registerNib:[UINib nibWithNibName:@"HRZShowGoodsSimpleInfoCell" bundle:nil] forCellWithReuseIdentifier:HRZListGridCellID];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

#pragma mark - ------------<UICollectionViewDataSource>--------------
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 1;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 0;
}

#pragma mark - CollectionCell
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    HRZShowGoodsSimpleInfoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:HRZListGridCellID forIndexPath:indexPath];
//    cell.goodsItem = _supplierItem.goodsArray[indexPath.row];
    return cell;
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    return itemSize;
}

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
    return 0;
}

#pragma mark - CollectionHeaderView

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    
}

@end
